package com.updesignsz.api.mapper;

import com.updesignsz.commom.entity.Article;
import com.updesignsz.commom.entity.News;
import net.sf.json.JSONObject;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 文章
 * Creation date 2020-8-8 15:06:04
 */
@Repository
@Mapper
public interface ArticleMapper {


    @Select({"<script>",
            "select *  from article ",
            "<where>",
            "<if test=\"type != null\" >AND type = #{type}</if>",
            "<if test=\"title != null\" >AND title like '%${title}%'</if>",
            "AND is_removed = 0",
            "</where>",
            "order by created_date desc",
            "</script>"
    })
    List<Article> findAll(JSONObject json);
}